﻿<Window x:Class="RoboSharp.BackupApp.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Backup App" Height="550" Width="725" ResizeMode="NoResize">
    <Grid>
        <TabControl>
            <TabItem Header="Options" Name="OptionsTab">
                <Grid Name="OptionsGrid">
                    <TextBlock HorizontalAlignment="Left" Margin="34,20,0,0" TextWrapping="Wrap" Text="Source" VerticalAlignment="Top"/>
                    <TextBox Name="Source" HorizontalAlignment="Left" Height="23" Margin="34,36,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="589"/>
                    <Button Name="SourceBrowseButton" HorizontalAlignment="Left" VerticalAlignment="Top" Width="75" Content="Browse" Margin="628,36,0,0" Click="SourceBrowseButton_Click" />

                    <TextBlock HorizontalAlignment="Left" Margin="34,80,0,0" TextWrapping="Wrap" Text="Destination" VerticalAlignment="Top"/>
                    <TextBox Name="Destination" HorizontalAlignment="Left" Height="23" Margin="34,96,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="589"/>
                    <Button Name="DestinationBrowseButton" HorizontalAlignment="Left" VerticalAlignment="Top" Width="75" Content="Browse" Margin="628,95,0,0" Click="DestinationBrowseButton_Click" />

                    <ScrollViewer Margin="34,135,10,50" VerticalScrollBarVisibility="Auto">
                        <StackPanel>
                            <Expander Background="LightBlue" Header="Copy Options">
                                <Grid Margin="10">
                                    <Grid.RowDefinitions>
                                        <RowDefinition />
                                        <RowDefinition />
                                        <RowDefinition />
                                        <RowDefinition />
                                        <RowDefinition />
                                        <RowDefinition />
                                        <RowDefinition />
                                        <RowDefinition />
                                        <RowDefinition />
                                        <RowDefinition />
                                        <RowDefinition />
                                        <RowDefinition />
                                        <RowDefinition />
                                        <RowDefinition />
                                        <RowDefinition />
                                        <RowDefinition />
                                        <RowDefinition />
                                        <RowDefinition />
                                        <RowDefinition />
                                        <RowDefinition />
                                        <RowDefinition />
                                        <RowDefinition />
                                        <RowDefinition />
                                        <RowDefinition />
                                        <RowDefinition />
                                        <RowDefinition />
                                        <RowDefinition />
                                        <RowDefinition />
                                        <RowDefinition />
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="5" />
                                        <ColumnDefinition />
                                    </Grid.ColumnDefinitions>

                                    <TextBlock Grid.Row="0" Grid.Column="0" Text="File Filter" />
                                    <TextBlock Grid.Row="1" Grid.Column="0" Text="Copy Subdirectories (/S)" />
                                    <TextBlock Grid.Row="2" Grid.Column="0" Text="Copy Subdirectories Including Empty (/E)" />
                                    <TextBlock Grid.Row="3" Grid.Column="0" Text="Depth (/LEV:N)" />
                                    <TextBlock Grid.Row="4" Grid.Column="0" Text="Enable Restart Mode (/Z)" />
                                    <TextBlock Grid.Row="5" Grid.Column="0" Text="Enable Backup Mode (/B)" />
                                    <TextBlock Grid.Row="6" Grid.Column="0" Text="Enable Restart Mode With Backup Fallback (/ZB)" />
                                    <TextBlock Grid.Row="7" Grid.Column="0" Text="Use Unbuffered I/O (/J)" />
                                    <TextBlock Grid.Row="8" Grid.Column="0" Text="Enable EFS Raw Mode (/EFSRAW)" />
                                    <TextBlock Grid.Row="9" Grid.Column="0" Text="Copy Flags (/COPY:copyflags)" />
                                    <TextBlock Grid.Row="10" Grid.Column="0" Text="Copy Files With Security (/SEC)" />
                                    <TextBlock Grid.Row="11" Grid.Column="0" Text="Copy All (/COPYALL)" />
                                    <TextBlock Grid.Row="12" Grid.Column="0" Text="Remove File Information (/NOCOPY)" />
                                    <TextBlock Grid.Row="13" Grid.Column="0" Text="Fix File Security On All Files (/SECFIX)" />
                                    <TextBlock Grid.Row="14" Grid.Column="0" Text="Fix File Times On All Files (/TIMFIX)" />
                                    <TextBlock Grid.Row="15" Grid.Column="0" Text="Purge (/PURGE)" />
                                    <TextBlock Grid.Row="16" Grid.Column="0" Text="Mirror (/MIR)" />
                                    <TextBlock Grid.Row="17" Grid.Column="0" Text="Move Files (/MOV)" />
                                    <TextBlock Grid.Row="18" Grid.Column="0" Text="Move Files and Directories (/MOVE)" />
                                    <TextBlock Grid.Row="19" Grid.Column="0" Text="Add Attributes (/A+:attributes)" />
                                    <TextBlock Grid.Row="20" Grid.Column="0" Text="Remove Attributes (/A-:attributes)" />
                                    <TextBlock Grid.Row="21" Grid.Column="0" Text="Create Directory and File Tree (/CREATE)" />
                                    <TextBlock Grid.Row="22" Grid.Column="0" Text="Fat Files (/FAT)" />
                                    <TextBlock Grid.Row="23" Grid.Column="0" Text="Turn Long Path Support Off (/256)" />
                                    <TextBlock Grid.Row="24" Grid.Column="0" Text="Monitor Source Changes Limit (/MON:N)" />
                                    <TextBlock Grid.Row="25" Grid.Column="0" Text="Monitor Source Time Limit (/MOT:N)" />

                                    <GridSplitter Width="5" Grid.Row="0" Grid.RowSpan="100" Grid.Column="1" ResizeBehavior="PreviousAndNext" ResizeDirection="Columns" />

                                    <TextBox Grid.Row="0" Grid.Column="2" Name="FileFilter" Margin="10,0,0,0" />
                                    <CheckBox Grid.Row="1" Grid.Column="2" Name="CopySubDirectories" Margin="10,0,0,0" />
                                    <CheckBox Grid.Row="2" Grid.Column="2" Name="CopySubdirectoriesIncludingEmpty" Margin="10,0,0,0" />
                                    <TextBox Grid.Row="3" Grid.Column="2" Name="Depth" Margin="10,0,0,0" PreviewTextInput="IsNumeric_PreviewTextInput" Width="50" HorizontalAlignment="Left" />
                                    <CheckBox Grid.Row="4" Grid.Column="2" Name="EnableRestartMode" Margin="10,0,0,0" />
                                    <CheckBox Grid.Row="5" Grid.Column="2" Name="EnableBackupMode" Margin="10,0,0,0" />
                                    <CheckBox Grid.Row="6" Grid.Column="2" Name="EnableRestartModeWithBackupFallback" Margin="10,0,0,0" />
                                    <CheckBox Grid.Row="7" Grid.Column="2" Name="UseUnbufferedIo" Margin="10,0,0,0" />
                                    <CheckBox Grid.Row="8" Grid.Column="2" Name="EnableEfsRawMode" Margin="10,0,0,0" />
                                    <TextBox Grid.Row="9" Grid.Column="2" Name="CopyFlags" Margin="10,0,0,0" PreviewTextInput="IsAttribute_PreviewTextInput" Width="100" HorizontalAlignment="Left" />
                                    <CheckBox Grid.Row="10" Grid.Column="2" Name="CopyFilesWithSecurity" Margin="10,0,0,0" />
                                    <CheckBox Grid.Row="11" Grid.Column="2" Name="CopyAll" Margin="10,0,0,0" />
                                    <CheckBox Grid.Row="12" Grid.Column="2" Name="RemoveFileInformation" Margin="10,0,0,0" />
                                    <CheckBox Grid.Row="13" Grid.Column="2" Name="FixFileSecurityOnAllFiles" Margin="10,0,0,0" />
                                    <CheckBox Grid.Row="14" Grid.Column="2" Name="FixFileTimesOnAllFiles" Margin="10,0,0,0" />
                                    <CheckBox Grid.Row="15" Grid.Column="2" Name="Purge" Margin="10,0,0,0" />
                                    <CheckBox Grid.Row="16" Grid.Column="2" Name="Mirror" Margin="10,0,0,0" />
                                    <CheckBox Grid.Row="17" Grid.Column="2" Name="MoveFiles" Margin="10,0,0,0" />
                                    <CheckBox Grid.Row="18" Grid.Column="2" Name="MoveFilesAndDirectories" Margin="10,0,0,0" />
                                    <TextBox Grid.Row="19" Grid.Column="2" Name="AddAttributes" Margin="10,0,0,0" PreviewTextInput="IsAttribute_PreviewTextInput" Width="100" HorizontalAlignment="Left" />
                                    <TextBox Grid.Row="20" Grid.Column="2" Name="RemoveAttributes" Margin="10,0,0,0" PreviewTextInput="IsAttribute_PreviewTextInput" Width="100" HorizontalAlignment="Left" />
                                    <CheckBox Grid.Row="21" Grid.Column="2" Name="CreateDirectoryAndFileTree" Margin="10,0,0,0" />
                                    <CheckBox Grid.Row="22" Grid.Column="2" Name="FatFiles" Margin="10,0,0,0" />
                                    <CheckBox Grid.Row="23" Grid.Column="2" Name="TurnLongPathSupportOff" Margin="10,0,0,0" />
                                    <TextBox Grid.Row="24" Grid.Column="2" Name="MonitorSourceChangesLimit" Margin="10,0,0,0" PreviewTextInput="IsNumeric_PreviewTextInput" Width="50" HorizontalAlignment="Left" />
                                    <TextBox Grid.Row="25" Grid.Column="2" Name="MonitorSourceTimeLimit" Margin="10,0,0,0" PreviewTextInput="IsNumeric_PreviewTextInput" Width="50" HorizontalAlignment="Left" />
                                </Grid>
                            </Expander>
                            <Expander Background="LightGreen" Header="Select Options">
                                <Grid Margin="10">
                                    <Grid.RowDefinitions>
                                        <RowDefinition />
                                        <RowDefinition />
                                        <RowDefinition />
                                        <RowDefinition />
                                        <RowDefinition />
                                        <RowDefinition />
                                        <RowDefinition />
                                        <RowDefinition />
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="5" />
                                        <ColumnDefinition />
                                    </Grid.ColumnDefinitions>

                                    <TextBlock Grid.Row="0" Grid.Column="0" Text="Only Copy Archive Files (/A)" />
                                    <TextBlock Grid.Row="1" Grid.Column="0" Text="Only Copy Archive Files And Reset Archive Flag (/M)" />
                                    <TextBlock Grid.Row="2" Grid.Column="0" Text="Include Attributes (/IA:attributes)" />
                                    <TextBlock Grid.Row="3" Grid.Column="0" Text="Exclude Attributes (/XA:attributes)" />
                                    <TextBlock Grid.Row="4" Grid.Column="0" Text="Exclude Files (/XF File File ...)" />
                                    <TextBlock Grid.Row="5" Grid.Column="0" Text="Exclude Directories (/XD Dir Dir ...)" />
                                    <TextBlock Grid.Row="6" Grid.Column="0" Text="Exclude Older (/XO)" />
                                    <TextBlock Grid.Row="7" Grid.Column="0" Text="Exclude Junction Points (/XJ)" />

                                    <GridSplitter Width="5" Grid.Row="0" Grid.RowSpan="100" Grid.Column="1" ResizeBehavior="PreviousAndNext" ResizeDirection="Columns" />

                                    <CheckBox Grid.Row="0" Grid.Column="2" Name="OnlyCopyArchiveFiles" Margin="10,0,0,0" />
                                    <CheckBox Grid.Row="1" Grid.Column="2" Name="OnlyCopyArchiveFilesAndResetArchiveFlag" Margin="10,0,0,0" />
                                    <TextBox Grid.Row="2" Grid.Column="2" Name="IncludeAttributes" Margin="10,0,0,0" PreviewTextInput="IsAttribute_PreviewTextInput" Width="100" HorizontalAlignment="Left" />
                                    <TextBox Grid.Row="3" Grid.Column="2" Name="ExcludeAttributes" Margin="10,0,0,0" PreviewTextInput="IsAttribute_PreviewTextInput" Width="100" HorizontalAlignment="Left" />
                                    <TextBox Grid.Row="4" Grid.Column="2" Name="ExcludeFiles" Margin="10,0,0,0" />
                                    <TextBox Grid.Row="5" Grid.Column="2" Name="ExcludeDirectories" Margin="10,0,0,0" />
                                    <CheckBox Grid.Row="6" Grid.Column="2" Name="ExcludeOlder" Margin="10,0,0,0" />
                                    <CheckBox Grid.Row="7" Grid.Column="2" Name="ExcludeJunctionPoints" Margin="10,0,0,0" />

                                </Grid>
                            </Expander>
                            <Expander Background="PaleGoldenrod" Header="Retry Options">
                                <Grid Margin="10">
                                    <Grid.RowDefinitions>
                                        <RowDefinition />
                                        <RowDefinition />
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="5" />
                                        <ColumnDefinition />
                                    </Grid.ColumnDefinitions>

                                    <TextBlock Grid.Row="0" Grid.Column="0" Text="Retry Count (/R:N)" />
                                    <TextBlock Grid.Row="1" Grid.Column="0" Text="Retry Wait Time (/W:N)" />

                                    <GridSplitter Width="5" Grid.Row="0" Grid.RowSpan="100" Grid.Column="1" ResizeBehavior="PreviousAndNext" ResizeDirection="Columns" />

                                    <TextBox Grid.Row="0" Grid.Column="2" Name="RetryCount" Margin="10,0,0,0" PreviewTextInput="IsNumeric_PreviewTextInput" Width="50" HorizontalAlignment="Left" />
                                    <TextBox Grid.Row="1" Grid.Column="2" Name="RetryWaitTime" Margin="10,0,0,0" PreviewTextInput="IsNumeric_PreviewTextInput" Width="50" HorizontalAlignment="Left" />

                                </Grid>

                            </Expander>
                            <Expander Background="LightGray" Header="Logging Options">
                                <Grid Margin="10">
                                    <Grid.RowDefinitions>
                                        <RowDefinition />
                                        <RowDefinition />
                                        <RowDefinition />
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="5" />
                                        <ColumnDefinition />
                                    </Grid.ColumnDefinitions>

                                    <TextBlock Grid.Row="0" Grid.Column="0" Text="Verbose Output (/V)" />
                                    <TextBlock Grid.Row="1" Grid.Column="0" Text="No File Size (/NS)" />
                                    <TextBlock Grid.Row="2" Grid.Column="0" Text="No Progress (/NP)" />

                                    <GridSplitter Width="5" Grid.Row="0" Grid.RowSpan="100" Grid.Column="1" ResizeBehavior="PreviousAndNext" ResizeDirection="Columns" />

                                    <CheckBox Grid.Row="0" Grid.Column="2" Name="VerboseOutput" Margin="10,0,0,0" />
                                    <CheckBox Grid.Row="1" Grid.Column="2" Name="NoFileSizes" Margin="10,0,0,0" />
                                    <CheckBox Grid.Row="2" Grid.Column="2" Name="NoProgress" Margin="10,0,0,0" />

                                </Grid>
                            </Expander>
                        </StackPanel>
                    </ScrollViewer>
                    
                    <Button Content="Backup" HorizontalAlignment="Right" Margin="0,0,10,10" VerticalAlignment="Bottom" Width="75" Click="Button_Click"/>
                </Grid>
            </TabItem>
            <TabItem Header="Progress" Name="ProgressTab">
                <Grid Name="ProgressGrid" IsEnabled="false">
                    <TextBlock HorizontalAlignment="Left" Margin="40,27,0,0" TextWrapping="Wrap" Text="Current Operation" VerticalAlignment="Top" FontWeight="Bold"/>
                    <TextBlock Name="CurrentOperation" HorizontalAlignment="Left" Margin="158,27,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Foreground="#FF000099"/>

                    <TextBlock HorizontalAlignment="Left" Margin="37,93,0,0" TextWrapping="Wrap" Text="Name" VerticalAlignment="Top" FontWeight="Bold"/>
                    <TextBlock Name="CurrentFile" TextWrapping="Wrap" TextTrimming="CharacterEllipsis" HorizontalAlignment="Left" Margin="37,114,0,0" VerticalAlignment="Top" Width="636" Height="83" Foreground="#FF009900"/>
                    <TextBlock HorizontalAlignment="Left" Margin="37,218,0,0" TextWrapping="Wrap" Text="Current File Copy Progress" VerticalAlignment="Top" FontWeight="Bold"/>
                    <ProgressBar Minimum="0" Maximum="100" Name="FileProgress" HorizontalAlignment="Left" Height="20" Margin="40,239,0,0" VerticalAlignment="Top" Width="625"/>
                    <TextBlock HorizontalAlignment="Left" Margin="40,60,0,0" TextWrapping="Wrap" Text="Size (bytes)" VerticalAlignment="Top" FontWeight="Bold"/>
                    <TextBlock Name="CurrentSize" HorizontalAlignment="Left" Margin="158,60,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Foreground="#FF444444"/>
                    <TextBlock Name="FileProgressPercent" FontWeight="Bold" TextAlignment="Right" HorizontalAlignment="Left" Margin="615,218,0,0" TextWrapping="Wrap" VerticalAlignment="Top" RenderTransformOrigin="1.76,-0.062"/>
                    <Button Name="PauseResumeButton" Click="PauseResumeButton_Click" VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="0,0,95,10" Content="Pause" Width="75" />
                    <Button Name="CancelButton" Click="CancelButton_Click" VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="0,0,10,10" Content="Cancel" Width="75" />
                </Grid>
            </TabItem>
            <TabItem Header="Errors" Name="ErrorsTab">
                <DataGrid Name="ErrorGrid"></DataGrid>
            </TabItem>
        </TabControl>
    </Grid>
</Window>
